package com.sinosoft.web.common;

import cn.com.sinux.spring.commons.SystemConfig;
import com.sinosoft.hydra.logging.LogModules;
import com.sinosoft.hydra.um.domain.model.DirectoryType;
import com.sinosoft.hydra.um.services.DirectoryService;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.File;

/**
 * 系统应用程序初始化 1、初始化该bean，加载数据库的所有角色 Created with IntelliJ IDEA. User: New Date:
 * 13-3-18 Time: 下午5:19 To change this template use File | Settings | File
 * Templates.
 */
public class ApplicationInitialization {

    private static final Logger logger = LoggerFactory.getLogger(LogModules.STD_LOGGER);

    @Autowired
    private DirectoryService directoryService;

    /**
     * 应用程序初始化
     */
    public void init() {
        //重启系统需要重置数据备份选项

        directoryService.addDirectory(DirectoryType.valueOf("DIRECTORY_BAKING"), "none");
        //创建目录
//        //创建根节点
//        FileUtils.createAllFolder(rootPath);
//        //创建根节点
//        FileUtils.createAllFolder(filePath);
//        //创建根节点
//        FileUtils.createAllFolder(configPath);
    }

    /**
     * 摧毁数据
     */
    public void destroy() {

    }
}
